![]() |
CanDocBeOpened |
||||
Header: | Translation.h | Carbon status: | Supported | |
Determines whether a specified application can open a particular document.
OSErr CanDocBeOpened ( const FSSpec *targetDocument, SInt16 appVRefNumHint, OSType appSignature, const FileType *nativeTypes, Boolean onlyNative, DocOpenMethod *howToOpen, FileTranslationSpec *howToTranslate );
A pointer to the document to check
The volume reference number of the volume containing the application. The search for the specified application begins on this volume; if the application isn’t found there, the search continues to other mounted volumes.
The signature of the application.
A pointer to the zero-terminated list of file types that the application can open without translation; if this parameter contains NULL, the default list of file types returned by the GetFileTypesThatAppCanNativelyOpen function is used.
If TRUE, determine only whether the application can open the document without translation; otherwise, determine whether the application can open the document after translation.
On return, a pointer to a constant indicating the method of opening the document. This field contains a meaningful value only if the function returns noErr (indicating that the specified document can be opened). See
On return, if the document needs to be translated before it can be opened, a pointer to a buffer of information (in a private format) indicating how to translate the document. You pass the information returned in this parameter to the TranslateFile function.
A result code. If the application can open the document, the function returns noErr.
A preference must have already been set (using the Document Converter tool) on how to open the document.
This function might cause memory to be moved or purged; you should not call it at interrupt time.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)